home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / liveconnect / nsISecurityContext.h < prev   
C/C++ Source or Header  |  2006-05-08  |  8KB  |  136 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  2.  *
  3.  * ***** BEGIN LICENSE BLOCK *****
  4.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  5.  *
  6.  * The contents of this file are subject to the Mozilla Public License Version
  7.  * 1.1 (the "License"); you may not use this file except in compliance with
  8.  * the License. You may obtain a copy of the License at
  9.  * http://www.mozilla.org/MPL/
  10.  *
  11.  * Software distributed under the License is distributed on an "AS IS" basis,
  12.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  13.  * for the specific language governing rights and limitations under the
  14.  * License.
  15.  *
  16.  * The Original Code is Mozilla Communicator client code, released
  17.  * March 31, 1998.
  18.  *
  19.  * The Initial Developer of the Original Code is
  20.  * Netscape Communications Corporation.
  21.  * Portions created by the Initial Developer are Copyright (C) 1998
  22.  * the Initial Developer. All Rights Reserved.
  23.  *
  24.  * Contributor(s):
  25.  *
  26.  * Alternatively, the contents of this file may be used under the terms of
  27.  * either of the GNU General Public License Version 2 or later (the "GPL"),
  28.  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  29.  * in which case the provisions of the GPL or the LGPL are applicable instead
  30.  * of those above. If you wish to allow use of your version of this file only
  31.  * under the terms of either the GPL or the LGPL, and not to allow others to
  32.  * use your version of this file under the terms of the MPL, indicate your
  33.  * decision by deleting the provisions above and replace them with the notice
  34.  * and other provisions required by the GPL or the LGPL. If you do not delete
  35.  * the provisions above, a recipient may use your version of this file under
  36.  * the terms of any one of the MPL, the GPL or the LGPL.
  37.  *
  38.  * ***** END LICENSE BLOCK ***** */
  39. /*
  40.  * This file is part of the Java-vendor-neutral implementation of LiveConnect
  41.  *
  42.  * It contains the public XP-COM based interface for java to javascript communication.
  43.  * This interface allows java and javascript to exchange security contexts to allow
  44.  * access to restricted resources on either side.
  45.  *
  46.  */
  47.  
  48. #ifndef nsISecurityContext_h___
  49. #define nsISecurityContext_h___
  50.  
  51. #include "nsISupports.h"
  52.  
  53. #define NS_ISECURITYCONTEXT_IID                          \
  54. { /* {209B1120-4C41-11d2-A1CB-00805F8F694D} */         \
  55.     0x209b1120,                                      \
  56.     0x4c41,                                          \
  57.     0x11d2,                                          \
  58.     { 0xa1, 0xcb, 0x0, 0x80, 0x5f, 0x8f, 0x69, 0x4d } \
  59. }
  60.  
  61. class nsISecurityContext : public nsISupports {
  62. public:
  63.  
  64.     NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISECURITYCONTEXT_IID)
  65.  
  66.     /**
  67.      * Get the security context to be used in LiveConnect.
  68.      * This is used for JavaScript <--> Java.
  69.      *
  70.      * @param target        -- Possible target.
  71.      * @param action        -- Possible action on the target.
  72.      * @return              -- NS_OK if the target and action is permitted on the security context.
  73.      *                      -- NS_FALSE otherwise.
  74.      */
  75.     NS_IMETHOD Implies(const char* target, const char* action, PRBool *bAllowedAccess) = 0;
  76.  
  77.     /**
  78.      * Get the origin associated with the context.
  79.      *
  80.      * @param buf        -- Result buffer (managed by the caller.)
  81.      * @param len        -- Buffer length.
  82.      * @return           -- NS_OK if the codebase string was obtained.
  83.      *                   -- NS_FALSE otherwise.
  84.      */
  85.     NS_IMETHOD GetOrigin(char* buf, int len) = 0;
  86.  
  87.     /**
  88.      * Get the certificate associated with the context.
  89.      *
  90.      * @param buf        -- Result buffer (managed by the caller.)
  91.      * @param len        -- Buffer length.
  92.      * @return           -- NS_OK if the codebase string was obtained.
  93.      *                   -- NS_FALSE otherwise.
  94.      */
  95.     NS_IMETHOD GetCertificateID(char* buf, int len) = 0;
  96. };
  97.  
  98.  
  99. // Supported targets in Netscape Navigator 4.0 (Communicator): 
  100.  
  101. #define nsSecurityTarget_UniversalThreadAccess "UniversalThreadAccess"       // allows manipulation of threads not belonging to the applet  
  102. #define nsSecurityTarget_UniversalExecAccess "UniversalExecAccess"           // allows executing sub-processes  
  103. #define nsSecurityTarget_UniversalExitAccess "UniversalExitAccess"           // allows terminating the browser session  
  104. #define nsSecurityTarget_UniversalLinkAccess "UniversalLinkAccess"           // allows linking to dymanically loaded libraries (DLLs)  
  105. #define nsSecurityTarget_UniversalPropertyWrite "UniversalPropertyWrite"     // allows reading and writing of all system properties (vs. restrictions on applets)  
  106. #define nsSecurityTarget_UniversalPropertyRead "UniversalPropertyRead"       // allows reading of all system properties (vs. restrictions on applets)  
  107. #define nsSecurityTarget_UniversalFileRead "UniversalFileRead"               // allows reading any file in the local filesystem  
  108. #define nsSecurityTarget_UniversalFileWrite "UniversalFileWrite"             // allows writing any file in the local filesystem  
  109. #define nsSecurityTarget_UniversalFileDelete "UniversalFileDelete"           // allows deleting of any file in the local filesystem  
  110. #define nsSecurityTarget_UniversalFdRead "UniversalFdRead"                   // allows reading from any arbitrary file descriptor  
  111. #define nsSecurityTarget_UniversalFdWrite "UniversalFdWrite"                 // allows writing to any arbitrary file descriptor  
  112. #define nsSecurityTarget_UniversalListen "UniversalListen"                   // allows establishing the server-side of a network connection  
  113. #define nsSecurityTarget_UniversalAccept "UniversalAccept"                   // allows waiting on a network connection  
  114. #define nsSecurityTarget_UniversalConnect "UniversalConnect"                 // allows establishing the client-side of a network connection  
  115. #define nsSecurityTarget_UniversalMulticast "UniversalMulticast"             // allows establishing IP multicast a network connection  
  116. #define nsSecurityTarget_UniversalTopLevelWindow "UniversalTopLevelWindow"   // allows top-level windows to be created by the applet writer.  
  117. #define nsSecurityTarget_UniversalPackageAccess "UniversalPackageAccess"     // allows access to java packages  
  118. #define nsSecurityTarget_UniversalPackageDefinition "UniversalPackageDefinition" // allows access to define packages  
  119. #define nsSecurityTarget_UniversalSetFactory "UniversalSetFactory"           // allows access to set a networking-related object factory  
  120. #define nsSecurityTarget_UniversalMemberAccess "UniversalMemberAccess"       // allows access to members of a class  
  121. #define nsSecurityTarget_UniversalPrintJobAccess "UniversalPrintJobAccess"   // allows access to initiate a print job request  
  122. #define nsSecurityTarget_UniversalSystemClipboardAccess "UniversalSystemClipboardAccess" // allows access to System Clipboard  
  123. #define nsSecurityTarget_UniversalAwtEventQueueAccess "UniversalAwtEventQueueAccess"     // allows access to Awt's EventQueue  
  124. #define nsSecurityTarget_UniversalSecurityProvider "UniversalSecurityProvider" // allows access to certain operations to a given provider, for example, only a given provider (e.g. Netscape) is able to retrieve the Netscape provider properties  
  125. #define nsSecurityTarget_UniversalBrowserRead "UniversalBrowserRead"           // allows access to browser data  
  126. #define nsSecurityTarget_UniversalBrowserWrite "UniversalBrowserWrite"         // allows modification of browser data  
  127. #define nsSecurityTarget_UniversalSendMail "UniversalSendMail"              // allows sending mail  
  128. #define nsSecurityTarget_SuperUser "SuperUser"                              // enables all privileges  
  129. #define nsSecurityTarget_30Capabilities "30Capabilities"                    // enables all privileges that are available in Navigator 3.0.  
  130. #define nsSecurityTarget_UniversalFileAccess "UniversalFileAccess"          // enables read, write and delete of any file in the local filesystem  
  131. #define nsSecurityTarget_TerminalEmulator "TerminalEmulator"                // enables socket connections, property read and to link dynamic libraries.  
  132.  
  133.  
  134.  
  135. #endif // nsISecurityContext_h___
  136.